﻿using System;

class UserVariableInput

            // Write a program that, depending on the user's choice inputs int, double or string variable. If the variable is integer or double, 
            // increases it with 1. If the variable is string, appends "*" at its end. The program must show the value of that variable as a console output.
            // Use switch statement.

{
    static void Main()
    {
        Console.WriteLine("Enter a variable");
        dynamic userVariable = Console.ReadLine();
        int intVar;
        bool stringInput = int.TryParse(userVariable, out intVar);

        switch (stringInput)
        {
            case true:
                intVar++;
                Console.WriteLine("An 'int' variable with value {0}", intVar);
                break;
            case false:
                double doubleVar;
                if (stringInput = double.TryParse(userVariable, out doubleVar))
                {
                    doubleVar++;
                    Console.WriteLine("A 'double' variable with value {0}!", doubleVar);
                }
                else
                {
                    Console.WriteLine("A 'string' variable with value {0}*!", userVariable);
                }
                break;
        }
    }
}
